﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Bleed : MonoBehaviour {

	// Use this for initialization
   private Slider hpUI;
    public float maxHealth=100;//最大血量
    public float currentHealth;//当前血量
    public float amount = 10;//每次受伤害时掉的血量

	void Start () {
        hpUI = GetComponent<Slider>();
        currentHealth = maxHealth;
        hpUI.maxValue = maxHealth;//
	}
	
	// Update is called once per frame
	void Update () {
        transform.rotation = Camera.main.transform.rotation;//让摄像机始终对着UI
        hpUI.value = currentHealth;

	}
}
